type go/printer.printer
64 uses
go/printer (current package)
gobuild.go#L13: func (p *printer) fixGoBuildLines() {
gobuild.go#L146: func (p *printer) lineAt(start int) []byte {
gobuild.go#L157: func (p *printer) commentTextAt(start int) string {
nodes.go#L46: func (p *printer) linebreak(line, min int, ws whiteSpace, newSection bool) (nbreaks int) {
nodes.go#L67: func (p *printer) setComment(g *ast.CommentGroup) {
nodes.go#L103: func (p *printer) identList(list []*ast.Ident, indent bool) {
nodes.go#L126: func (p *printer) exprList(prev0 token.Pos, list []ast.Expr, depth int, mode exprListMode, next0 token.Pos, isIncomplete bool) {
nodes.go#L328: func (p *printer) parameters(fields *ast.FieldList, mode paramMode) {
nodes.go#L435: func (p *printer) signature(sig *ast.FuncType) {
nodes.go#L471: func (p *printer) isOneLineFieldList(list []*ast.Field) bool {
nodes.go#L489: func (p *printer) setLineComment(text string) {
nodes.go#L493: func (p *printer) fieldList(fields *ast.FieldList, isStruct, isIncomplete bool) {
nodes.go#L768: func (p *printer) binaryExpr(x *ast.BinaryExpr, prec1, cutoff, depth int) {
nodes.go#L813: func (p *printer) expr1(expr ast.Expr, prec1, depth int) {
nodes.go#L1147: func (p *printer) possibleSelectorExpr(expr ast.Expr, prec1, depth int) bool {
nodes.go#L1157: func (p *printer) selectorExpr(x *ast.SelectorExpr, depth int, isMethod bool) bool {
nodes.go#L1174: func (p *printer) expr0(x ast.Expr, depth int) {
nodes.go#L1178: func (p *printer) expr(x ast.Expr) {
nodes.go#L1189: func (p *printer) stmtList(list []ast.Stmt, nindent int, nextIsRBrace bool) {
nodes.go#L1227: func (p *printer) block(b *ast.BlockStmt, nindent int) {
nodes.go#L1279: func (p *printer) controlClause(isForStmt bool, init ast.Stmt, expr ast.Expr, post ast.Stmt) {
nodes.go#L1316: func (p *printer) indentList(list []ast.Expr) bool {
nodes.go#L1347: func (p *printer) stmt(stmt ast.Stmt, nextIsRBrace bool) {
nodes.go#L1615: func (p *printer) valueSpec(s *ast.ValueSpec, keepType bool) {
nodes.go#L1685: func (p *printer) spec(spec ast.Spec, n int, doIndent bool) {
nodes.go#L1735: func (p *printer) genDecl(d *ast.GenDecl) {
nodes.go#L1803: func (p *printer) nodeSize(n ast.Node, maxSize int) (size int) {
nodes.go#L1832: func (p *printer) numLines(n ast.Node) int {
nodes.go#L1842: func (p *printer) bodySize(b *ast.BlockStmt, maxSize int) int {
nodes.go#L1872: func (p *printer) funcBody(headerSize int, sep whiteSpace, b *ast.BlockStmt) {
nodes.go#L1913: func (p *printer) distanceFrom(startPos token.Pos, startOutCol int) int {
nodes.go#L1920: func (p *printer) funcDecl(d *ast.FuncDecl) {
nodes.go#L1937: func (p *printer) decl(decl ast.Decl) {
nodes.go#L1965: func (p *printer) declList(list []ast.Decl) {
nodes.go#L1992: func (p *printer) file(src *ast.File) {
printer.go#L54: type printer struct {
printer.go#L99: func (p *printer) internalError(msg ...any) {
printer.go#L110: func (p *printer) commentsHaveNewline(list []*ast.Comment) bool {
printer.go#L126: func (p *printer) nextComment() {
printer.go#L146: func (p *printer) commentBefore(next token.Position) bool {
printer.go#L152: func (p *printer) commentSizeBefore(next token.Position) int {
printer.go#L172: func (p *printer) recordLine(linePtr *int) {
printer.go#L180: func (p *printer) linesFrom(line int) int {
printer.go#L184: func (p *printer) posFor(pos token.Pos) token.Position {
printer.go#L189: func (p *printer) lineFor(pos token.Pos) int {
printer.go#L198: func (p *printer) writeLineDirective(pos token.Position) {
printer.go#L217: func (p *printer) writeIndent() {
printer.go#L233: func (p *printer) writeByte(ch byte, n int) {
printer.go#L280: func (p *printer) writeString(pos token.Position, s string, isLit bool) {
printer.go#L349: func (p *printer) writeCommentPrefix(pos, next token.Position, prev *ast.Comment, tok token.Token) {
printer.go#L629: func (p *printer) writeComment(comment *ast.Comment) {
printer.go#L689: func (p *printer) writeCommentSuffix(needsLinebreak bool) (wroteNewline, droppedFF bool) {
printer.go#L723: func (p *printer) containsLinebreak() bool {
printer.go#L737: func (p *printer) intersperseComments(next token.Position, tok token.Token) (wroteNewline, droppedFF bool) {
printer.go#L817: func (p *printer) writeWhitespace(n int) {
printer.go#L885: func (p *printer) setPos(pos token.Pos) {
printer.go#L901: func (p *printer) print(args ...any) {
printer.go#L1037: func (p *printer) flush(next token.Position, tok token.Token) (wroteNewline, droppedFF bool) {
printer.go#L1091: func (p *printer) printNode(node any) error {
printer.go#L1325: return &printer{
printer.go#L1335: func newPrinter(cfg *Config, fset *token.FileSet, nodeSizes map[ast.Node]int) *printer {
printer.go#L1336: p := printerPool.Get().(*printer)
printer.go#L1337: *p = printer{
printer.go#L1350: func (p *printer) free() {